package 面向对象初级.HomeWork;

//测试类
public class MyIntTest {
        public static void main(String[] args) {
            // 创建MyInt对象并测试
            MyInt myInt1 = new MyInt(10);

            System.out.println("是否是自然数: " + myInt1.isNatural());
            System.out.println("约数个数: " + myInt1.approximateNumberCount());
            System.out.println("是否是素数: " + myInt1.isPrimeNumber());

            int[] primes = myInt1.getAllPrimeNumber();
            System.out.print("所有约数: ");
            for (int prime : primes) {
                System.out.print(prime + " ");
            }
            System.out.println();

            MyInt myInt2 = new MyInt(7);

            System.out.println("是否是自然数: " + myInt2.isNatural());
            System.out.println("约数个数: " + myInt2.approximateNumberCount());
            System.out.println("是否是素数: " + myInt2.isPrimeNumber());

            primes = myInt2.getAllPrimeNumber();
            System.out.print("所有约数: ");
            for (int prime : primes) {
                System.out.print(prime + " ");
            }
            System.out.println();
        }
    }
